{
  admin off
  auto_https off
}
:443 {
  tls /data/cert.crt /data/cert.key

  # Public endpoints (no authentication)
  handle_path /public/* {
    reverse_proxy filebrowser-app:80 {
      header_up Host {host}
      header_up X-Forwarded-For {remote_host}
      header_up X-Forwarded-Proto {scheme}
    }
  }

  # Private endpoints (with authentication)
  handle /* {
    reverse_proxy filebrowser-app:80 {
      header_up Host {host}
      header_up X-Forwarded-For {remote_host}
      header_up X-Forwarded-Proto {scheme}
    }
  }

  reverse_proxy filebrowser-app:80 {
    header_up Connection {>Connection}
    header_up Transfer-Encoding {>Transfer-Encoding}
  }
}
